import cv2 as cv
import numpy as np

img = cv.imread("assets/lena.jpg")

'''
H = np.float32([[1, 0, 50], [0, 1, 25]])
rows, cols = img.shape[:2]
print(img.shape)
print(rows, cols)
res = cv.warpAffine(img, H, (cols, rows))  
cv.imshow('origin_picture', img)
cv.imshow('new_picture', res)
cv.waitKey(0)
'''

rows, cols, channels = img.shape

#M = cv.getRotationMatrix2D((cols/2, rows/2), 45, 0.5)

p1 = np.float32([[0,0], [100,0], [0,100]])
p2 = np.float32([[100,50], [200,50], [0,100]])
M = cv.getAffineTransform(p1, p2)
print(M)
dst = cv.warpAffine(img, M, (cols,rows))
cv.imshow('original', img)
cv.imshow('result', dst)
cv.waitKey(0)
cv.destroyAllWindows()